#include "dialogrepassword.h"
#include "ui_dialogrepassword.h"
#include <QMessageBox>

DialogRePassword::DialogRePassword(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::DialogRePassword)
{
    ui->setupUi(this);
}

DialogRePassword::~DialogRePassword()
{
    delete ui;
}

void DialogRePassword::on_buttonBox_accepted()
{
    if(ui->lineEdit_new->text().length()>0 && (ui->lineEdit_new->text()==ui->lineEdit_new2->text()))
        this->accept();
    else
    {
        QMessageBox::information(this,"错误","请输入新密码，并2次一致！",QMessageBox::Ok);

    }
}
QString DialogRePassword::getnewPwd()
{
    return ui->lineEdit_new->text();
}
QString DialogRePassword::getoldPwd()
{
    return ui->lineEdit_old->text();
}
